JavaScript

{grid.object}getSelectedRow Method

Syntax

{grid.object}.getSelectedRow()

Description

Returns the selected row number, or null if no row is selected.

Discussion

The {grid.object}.getSelectedRow() method replaced the internal ._selectedRow property. Previously, users were using the internal ._selectedRow property to get the row number of the currently selected row. However, under some circumstances this property can return a confusing (but technically correct) value. For example, if the refresh method on the Grid is set to 'Auto' and a minimal refresh is done after an update, insert or delete operation and the user deletes a row, the ._selectedRow property will return the row number of the row that was just deleted (which is actually correct internally, because the row that was deleted has simply been hidden in the page and it is still marked as selected).

On the other hand. the {grid.object}.getSelectedRow() method will return null, indicating that no row is currently selected.

See Also